home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / init.d / keyboard-setup < prev    next >
Text File  |  2008-06-11  |  1KB  |  59 lines

  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          keyboard-setup
  4. # Required-Start:    mountkernfs udev
  5. # Required-Stop:
  6. # Should-Start:      keymap
  7. # X-Start-Before:    checkroot
  8. # Default-Start:     S
  9. # Default-Stop:
  10. # Short-Description: Set preliminary keymap
  11. # Description:       Set the console keyboard as early as possible
  12. #                    so during the file systems checks the administrator
  13. #                    can interact.  At this stage of the boot process
  14. #                    only the ASCII symbols are supported.
  15. ### END INIT INFO
  16.  
  17. set -e
  18.  
  19. test -f /bin/setupcon || exit 0
  20.  
  21. if [ -f /lib/lsb/init-functions ]; then
  22.     . /lib/lsb/init-functions
  23. else
  24.     log_action_begin_msg () {
  25.     echo -n "$@... "
  26.     }
  27.  
  28.     log_action_end_msg () {
  29.     if [ "$1" -eq 0 ]; then 
  30.         echo done.
  31.     else
  32.         echo failed.
  33.     fi
  34.     }
  35. fi
  36.  
  37. case "$1" in
  38.     stop)
  39.         # keyboard-setup isn't a daemon
  40.         ;;
  41.     start|force-reload|restart|reload)
  42.     # If usplash is running, then the console will be in raw mode and
  43.     # loadkeys will do confusing things to the keymap, so don't try.
  44.     if ! pidof usplash >/dev/null; then
  45.         log_action_begin_msg "Setting preliminary keymap"
  46.         if setupcon -k --force; then
  47.         log_action_end_msg 0
  48.         else
  49.         log_action_end_msg $?
  50.         fi
  51.     fi
  52.     ;;
  53.     *)
  54.         echo 'Usage: /etc/init.d/keyboard-setup {start|reload|restart|force-reload|stop}'
  55.         exit 1
  56.         ;;
  57. esac
  58.  
  59.